import 'package:flutter/material.dart';

class ContainerRoute extends StatelessWidget {
  const ContainerRoute({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('容器 Container'),
      ),
      body: SingleChildScrollView(
        child: Column(
          children: <Widget>[
            Container(
              margin: const EdgeInsets.only(top: 50.0, left: 120.0),
              constraints: const BoxConstraints.expand(width: 200, height: 150),
              decoration: const BoxDecoration(
                gradient: RadialGradient(
                  colors: [Colors.red, Colors.orange],
                  center: Alignment.topLeft,
                  radius: .98,
                ),
                boxShadow: [
                  BoxShadow(
                      color: Colors.white54,
                      offset: Offset(2, 2),
                      blurRadius: 4.0)
                ],
              ),
              transform: Matrix4.rotationZ(0.2),
              alignment: Alignment.center,
              child: const Text(
                "520",
                style: TextStyle(fontSize: 40, color: Colors.white),
              ),
            ),
            const SizedBox(height: 50),
            const Padding(
              padding: EdgeInsets.all(20),
              child: DecoratedBox(
                decoration: BoxDecoration(color: Colors.orange),
                child: Text("Hello world!"),
              ),
            ),
            const SizedBox(height: 10),
            const DecoratedBox(
              decoration: BoxDecoration(color: Colors.orange),
              child: Padding(
                padding: EdgeInsets.all(20),
                child: Text("Hello world!"),
              ),
            )
          ],
        ),
      ),
    );
  }
}
